/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-09-14
 * Time: 10:25
 */
public class Hello {
    public static void main(String[] args) {
        System.out.println(Math.round(11.5));
        int sum = StrToInt("+123");
        System.out.println(sum);
    }
    public static  int StrToInt(String str) {
        if( str.charAt(0) !='+' && str.charAt(0) != '-') {
            return 0;
        }
        int sum =0;
        for( int i = 1; i < str.length(); i++) {
            char ch =  str.charAt(i);
            if( ch >='0' &&  ch <= '9') {
                sum += (ch-'0') * (Math.pow( 10,str.length()-i-1));
            } else {
                return 0;
            }
        }
        return sum;

    }
}
